<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>部门信息</title>
<script type="text/javascript">
	function delConfirm() {
		var result = window.confirm('确认要删除该项吗？')
		return result;
	}
</script>
</head>
<body>
	<table border="1px" align="center" width="50%" cellpadding="0"
		cellspacing="0">
		<tr align="center">
			<td>编号</td>
			<td>部门名称</td>
			<td>部门地址</td>
			<td>操作</td>
		</tr>
		<c:forEach var="dept" items="${deptPage.deptList }"
			varStatus="deptstatus">
			<tr align="center">
				<td>${deptstatus.count }</td>
				<td>${dept.deptName }</td>
				<td>${dept.deptLocation }</td>
				<td><a
					href="${pageContext.request.contextPath }/servlet/updatedeptpageservlet?id=${dept.deptId}">更新</a>&nbsp;&nbsp;&nbsp;
					<a
					href="${pageContext.request.contextPath }/servlet/delectdeptservlet?id=${dept.deptId}"
					onclick="return delConfirm()">删除</a>&nbsp;&nbsp;&nbsp;</td>
			</tr>
		</c:forEach>
		<tr>
			<td colspan="4" align="right">共${deptPage.pageNum }页&nbsp&nbsp&nbsp&nbsp<a
				href="${pageContext.request.contextPath }/servlet/showdeptservlet?currentPage=1">首页</a>&nbsp;&nbsp;&nbsp;
				<a
				href="${pageContext.request.contextPath }/servlet/showdeptservlet?currentPage=${deptPage.prePage}">上一页</a>&nbsp;&nbsp;&nbsp;
				<c:forEach begin="1" end="${deptPage.pageNum }" var="page">
					<a
						href="${pageContext.request.contextPath }/servlet/showdeptservlet?currentPage=${page}">${page}</a>&nbsp;&nbsp;&nbsp;
			</c:forEach> <a
				href="${pageContext.request.contextPath }/servlet/showdeptservlet?currentPage=${deptPage.nextPage}">下一页</a>&nbsp;&nbsp;&nbsp;
				<a
				href="${pageContext.request.contextPath }/servlet/showdeptservlet?currentPage=${deptPage.pageNum}">尾页</a>&nbsp;&nbsp;&nbsp;
			</td>
		</tr>

	</table>
</body>
</html>